<?php
/**
* Copyright (c) 2002-2007 BioWare Corp.
* http://www.bigdaddymonitor.org
*
* This file is part of the BigDaddy Monitoring
* program. It is free software distributed under
* the terms of the BSD License. It is ditributed
* in the hopes that it will be useful, but
* WITHOUT ANY WARRANTY; without event the implied
* warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE.
*
* The BSD License is available from:
* http://www.opensource.org/licenses/bsd-license.php
**/

switch($_REQUEST["page"])
{
	//Does the cron start
	case "SetCronStart":
		$pageParams["noDisplay"] = 1;
		$_REQUEST['cronID'] = $FormInput->ProcessInput($_REQUEST['cronID'], "ONLY_NUMERIC");
		$_REQUEST['option'] = $FormInput->ProcessInput($_REQUEST['option'], "CONVERT_SPECIAL_CHARS");
		if ($_REQUEST['cronID'] > 0)
		{
			if ($BigDaddyControl->GetCronStatus($_REQUEST['cronID'], $_REQUEST['option']))
			{
				$BigDaddyControl->SetCronStart($_REQUEST['cronID']);
				echo "Success";
			}
			else
			{
				echo "Fail";
			}
		}
		break;
	//Does the cron end
	case "SetCronEnd":
		$pageParams["noDisplay"] = 1;
		$_REQUEST['cronID'] = $FormInput->ProcessInput($_REQUEST['cronID'], "ONLY_NUMERIC");
		if ($_REQUEST['cronID'] > 0)
		{
			$BigDaddyControl->SetCronEnd($_REQUEST['cronID']);
			echo "Done";
		}
		else
		{
			echo "Fail";
		}
		break;
	//Does the cron log
	case "SetCronLog":
		$pageParams["noDisplay"] = 1;
		$_REQUEST['cronID'] = $FormInput->ProcessInput($_REQUEST['cronID'], "ONLY_NUMERIC");
		$_REQUEST['log'] = urldecode($_REQUEST['log']);
		$_REQUEST['log'] = $FormInput->ProcessInput($_REQUEST['log'], "DB_SANTIZE_STRING");
		if ($_REQUEST['cronID'] > 0 && $_REQUEST['log'] != '')
		{
			$BigDaddyControl->SetCronLog($_REQUEST['cronID'], $_REQUEST['log']);
			echo "Done";
		}
		else
		{
			echo "Fail";
		}
		break;
}


?>
